import QQMapWX from './qqmap-wx-jssdk';
// 发起regeocoding逆地址解析 -- 从经纬度转换为地址信息
const key = 'XOZBZ-OGJ6T-EWNX7-VH6ZV-IFUPH-YABIB'
const getRegeocoding = (latitude: string, longitude: string) => {
	let txMap = new QQMapWX({
		key
	});
	return new Promise(resolve => {
		txMap.reverseGeocoder({
			location: latitude + ',' + longitude,
			success: function(res) {
				resolve(res)
			},
			fail: function(res) {
				console.log(res, '请开启位置服务权限并重试!')
			},
			complete: function(res) {
				console.log(res);
			}
		});
	})
}


export default {
    getRegeocoding
}